package org.xteam.box2text.oaw;

import org.eclipse.internal.xtend.expression.parser.SyntaxConstants;

public class BoxUtil {

	public static final String BOX_EXTENSION = "box";
	
	public static String withoutLastSegment(final String fqn) {
		if (fqn == null || fqn.lastIndexOf(SyntaxConstants.NS_DELIM) == -1)
			return null;
		return fqn.substring(0, fqn.lastIndexOf(SyntaxConstants.NS_DELIM));
	}
	
	public static String getLastSegment(final String fqn) {
		if (fqn == null || fqn.lastIndexOf(SyntaxConstants.NS_DELIM) == -1)
			return fqn;
		return fqn.substring(fqn.lastIndexOf(SyntaxConstants.NS_DELIM) + SyntaxConstants.NS_DELIM.length());
	}

}
